The UI Is Object-Oriented

This idea is more recent than the other two, because it wasn't until a few years ago that graphical user interfaces and window systems came along. When they did, UI's began to be composed of multiple user activities represented by visually-distinct and physically-manipulable objects on the screen. Object-oriented programming (OOP) is thus a natural programming style which has been associated with UI since its beginning1. For several reasons, OOP is a nice fit for UI programming. UI's tend to generate profuse variation of detail around a basic theme (consider, for example, menus); that is, they demonstrate several subclasses of a basic class. The modularity of objects also helps to separate the UI from the semantics; that is, the implementation of UI methods from the program which simply calls them.

The OOP methodology leads to a UI which is composed of user interface objects (command lines, messages, menus, scroll bars, dialogs, etc.). Each of these UI objects is an ``agent'' for some portion of the underlying application. Each UI object is responsible for presenting some ``view'' of the application to the user. It is also responsible for receiving the users events which are directed to it and for translating these into the appropriate application responses.